// txt_pqdif.cpp : Defines the class behaviors for the application.
//

#include "stdafx.h"
#include "txt_pqdif.h"
#include "txt_pqdifDlg.h"
#include "helpers.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CTxt_pqdifApp

BEGIN_MESSAGE_MAP(CTxt_pqdifApp, CWinApp)
	//{{AFX_MSG_MAP(CTxt_pqdifApp)
		// NOTE - the ClassWizard will add and remove mapping macros here.
		//    DO NOT EDIT what you see in these blocks of generated code!
	//}}AFX_MSG
	ON_COMMAND(ID_HELP, CWinApp::OnHelp)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CTxt_pqdifApp construction

CTxt_pqdifApp::CTxt_pqdifApp()
{
	// Place all significant initialization in InitInstance
}

/////////////////////////////////////////////////////////////////////////////
// The one and only CTxt_pqdifApp object

CTxt_pqdifApp theApp;

static CTxt_pqdifDlg *gpDlg = NULL;

/////////////////////////////////////////////////////////////////////////////
// CTxt_pqdifApp initialization

BOOL CTxt_pqdifApp::InitInstance()
{
	// Standard initialization
	// If you are not using these features and wish to reduce the size
	//  of your final executable, you should remove from the following
	//  the specific initialization routines you do not need.

//#ifdef _AFXDLL
//	Enable3dControls();			// Call this when using MFC in a shared DLL
//#else
//	Enable3dControlsStatic();	// Call this when linking to MFC statically
//#endif
	InitPQDIFSupport();
	gpDlg = new CTxt_pqdifDlg;
	m_pMainWnd = gpDlg;
	gpDlg->Create ();
	return TRUE;
}


int CTxt_pqdifApp::ExitInstance() 
{
	if (gpDlg) {
		delete gpDlg;
		gpDlg = NULL;
	}
	//CleanupPQDIFSupport();
	
	return CWinApp::ExitInstance();
}

void CTxt_pqdifApp::WinHelp(DWORD dwData, UINT nCmd) 
{
	nCmd = HELP_CONTEXT;
	dwData = gpDlg->GetHelpContext();
	
	CWinApp::WinHelp(dwData, nCmd);
}
